<div id="viewbook_border">
<?php
    echo $this->Html->script(array('pc.js'));
    echo $this->Html->css(array('pc.css'));
    echo $this->Form->create('formSettingEmail',array('name'=>'formSettingEmail','id'=>'formSettingEmail','type'=>'file'));
?>
    <div style="width: 100%; margin-top: 50px;">
        <div style="width: 80%; margin: 0px auto;">
            <table width="100%">
                <tr>
                    <td height="40px" width="25%">
			            <div>
			                	メール
			            </div>
		            </td>
		            <td width="75%">
		                <div>
                            <input style="width: 300px;" maxlength="100" type="text" id="email" name="email" value='<?php 
                                    foreach ($settingemail as $emailContent) {
                                        echo trim($emailContent['Mailtemplate']['email']);
                                    }
                                ?>'>
                        </div>
		            </td>
	            </tr>
	            <tr>
		            <td height="40px">
			            <div>
			                	パスワード 
			            </div>
		            </td>
		            <td>
                        <div>
                            <input style="width: 150px;" maxlength="100" type="password" id="password" name="password" value='<?php 
                                    foreach ($settingemail as $emailContent) {
                                        echo trim($emailContent['Mailtemplate']['password']);
                                    }
                                ?>'>
                        </div>
                    </td>
                </tr>
                <tr>
		            <td height="40px">
			            <div>
			                	メールサーバー(SMTP) 
			            </div>
		            </td>
		            <td>
                        <div>
                            <input style="width: 300px;" maxlength="100" type="text" id="host" name="host" value='<?php 
                                    foreach ($settingemail as $emailContent) {
                                        echo trim($emailContent['Mailtemplate']['host']);
                                    }
                                ?>'>
                        </div>
                    </td>
                </tr>
                <tr>
		            <td height="40px">
			            <div>
			                	ポート
			            </div>
		            </td>
		            <td>
                        <div>
                            <input style="width: 50px;" maxlength="10" type="text" id="port" name="port" value='<?php 
                                    foreach ($settingemail as $emailContent) {
                                        echo trim($emailContent['Mailtemplate']['port']);
                                    }
                                ?>'>
                        </div>
                    </td>
	            </tr>
                <tr>
		            <td height="40px">
			            <div>
			                	タイトル
			            </div>
		            </td>
		            <td>
                        <div>
                            <input style="width: 300px;" maxlength="200" type="text" id="subject" name="subject" value='<?php 
                                    foreach ($settingemail as $emailContent) {
                                        echo trim($emailContent['Mailtemplate']['subject']);
                                    }
                                ?>'>
                        </div>
                    </td>
	            </tr>
                <tr>
		            <td height="40px" style="vertical-align: top;">
			            <div>
			                	メール文言 
			            </div>
                    </td>
                    <td>
                        <div>
                            <textarea id="template" maxlength='1000' name="template" rows="5" cols="50"><?php foreach ($settingemail as $emailContent) {echo trim($emailContent['Mailtemplate']['template']);}?></textarea>
                        </div>
                    </td>
                </tr>
            </table>
            <div style="text-align: center; margin-top: 15px;">
                <input style="width: 200px; height: 50px; font-size: 20px;" type="submit" id="btnSaveSetting" name="btnSaveSetting" value="保存">
            </div>
        </div>
    </div>
<?php
    if (isset($flagSuccess)) {
        echo "<script>alert('正常に保存しました。');</script>";
    }
    echo $this->Form->end();
?>
</div>